package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author lixinchen
 */
@Getter
public enum PaymentStatusEnum {
    /**
     * 未打款
     */
    UNPAID(0, "未打款"),

    /**
     * 已打款
     */
    PAID( 1, "已打款"),
    ;

    private final Integer key;
    private final String desc;

    PaymentStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static PaymentStatusEnum getByKey(Integer key){
        for (PaymentStatusEnum item : PaymentStatusEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
